<div class="content_info">
<form name="frmSearch" id="frmSearch" action="<?php echo BASE_URL_CLUB.'/admin/listcomment' ?>" method="POST" enctype="multipart/form-data">
    <table class="list_info">
        <tbody>
            <tr>
                <td>
                    Theo:&nbsp;<input type="radio" value="1" name="RDC[]" onclick="changeSearch(1);" <?php echo $this->articleid>0?'':'checked';?> />Mới nhất&nbsp;&nbsp;|&nbsp;&nbsp;<input type="radio" value="2" name="RDC[]" onclick="changeSearch(2);" <?php echo $this->articleid>0?'checked':'';?> />Bài viết
                </td>
            </tr>
            <tr id="articleBlock" style="display: <?php echo $this->articleid>0?'block':'none';?>">
                <td style="border:none;">
                    Article ID:
                    <input type="text" name="id" id="id" value="<?php echo $this->articleid; ?>">
                </td>
            </tr>
            <tr>
                <td style="border:none;">
                    <div class="btn">
                        <input type="submit" id="btnSearch" value="Tìm kiếm">
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <?php if($this->total > 0)
    {?>

    <?php echo $this->pagingHTML ?>
    <div class="clear"></div>
    <table class="list_info">
        <tbody>
            <tr>
                <th width="10%">Comment ID</th>
                <th width="10%">Article ID</th>
                <th width="50%">Nội dung</th>
                <th width="15%">Ngày tạo</th>
                <th width="15%">Tùy chọn</th>
            </tr>
             <?php
            foreach ($this->arrData as $key=>$value)
            {
            ?>
            <tr>
                <td class="infor" width="10%">
                    <?php echo $value['commentid'];?>
                </td>
                <td class="infor" width="10%">
                <?php if ( $this->articleid>0 && $this->type==2 ) {?>
                    <a href="<?php echo BASE_URL_CLUB;?>/index/detail/id/<?php echo $this->articleid;?>#comment" target="_blank"><?php echo $this->articleid;?></a>
                <?php } else {?>
                    <a href="<?php echo BASE_URL_CLUB;?>/index/detail/id/<?php echo $value['articleid'];?>#comment" target="_blank"><?php echo $value['articleid'];?></a>
                <?php }//end if?>
                </td>
                <td class="tieu_de infor" width="50%"><?php echo nl2br($this->escape($value['content']));?></td>
                <td class="infor" width="15%"><?php echo $this->DateTimeDiff($value['creation_time']); ?></td>
                <td class="infor" width="15%">
                <?php if ( $this->articleid>0 && $this->type==2 ) {?>
                    <a href="<?php echo BASE_URL_CLUB.'/admin/deletecomment/type/2/commentid/'.$value['commentid'].'/articleid/'.$this->articleid;?>" onclick="return confirm('Are you sure to delete?')">Delete</a>
                <?php } else {?>
                    <a href="<?php echo BASE_URL_CLUB.'/admin/deletecomment/type/1/commentid/'.$value['commentid'].'/articleid/'.$value['articleid'];?>" onclick="return confirm('Are you sure to delete?')">Delete</a>
                <?php }//end if?>
                </td>
            </tr>
            <?php
            } //End for
            ?>
        </tbody>
    </table>    
    <div class="total_item">
        Có tổng cộng <b><?php echo $this->total;?></b> mẫu tin
    </div>
    <?php echo $this->pagingHTML ?>
    <?php } //End If
    else
    {?>
    <div class="total_item" style="width: 500px;">
        <b>Không tìm thấy mẫu tin nào</b>
    </div>
    <?php
    }
    ?>    
</form>
</div>

<script type="text/javascript">
function changeSearch(id)
{
    if ( id == 2 ) {
        $("#articleBlock").show();
    } else {
        $("#articleBlock").hide();
    }
}
</script>